﻿@{
    ViewData["Title1"] = "MachineOnline";
}
<style>
    #c1, #c2, #c3 {
        float: left
    }

    .bottom-center {
    }

    .c1 {
    }

    .SmallChart {
        float: left;
        height: 480px;
        width: 30%;
    }

    .BigChart {
        float: left;
        height: 900px;
        width: 65%;
    }

    div {
        /*border: 1px solid #FF6699;*/
    }

    .login {
        /*position: absolute;*/
        position: fixed;
        top: 50%;
        left: 50%;
        margin-top: -100px;
        margin-left: -200px;
        background: rgba(229, 229, 216, 0.75);
        width: 400px;
        height: 200px;
        border-radius: 10px;
        display: none;
        /*display: none;*/
        /*background: url(loginBG.png) no-repeat;*/
    }

    .btnLogin .btnCancel {
        margin-right: 10px;
        padding: 5px 15px;
        /*background: #F9C;*/
        border-radius: 3px;
        height: 45px;
        width: 80px;
        display: none;
    }


    .btnOpen {
        width: 30px;
        height: 30px;
        font: italic bold 12px arial,sans-serif,Microsoft Yahei;
        background-color: transparent;
        color: cornsilk;
        text-align: start;
        background: url(user.jpg) no-repeat;
        background-size: contain;
    }

    .myButton, #div_uidpwd {
        /*margin-left: 5px;*/
        font-size: 18px;
    }

    .myButton {
        width: 70px;
        height: 40px;
    }

    .btnCloseWin {
        right: -0.3%;
        top: -0.2%;
        position: absolute;
        background-color: #ff5d6c;
        border: none;
        border-radius: 6px;
    }

        .btnCloseWin:hover {
            background-color: red;
            color: azure;
            font-style: oblique;
        }

    .alert-success {
        color: #3c763d;
        background-color: #dff0d8;
        border-color: #d6e9c6;
    }

    .alert {
        display: none;
        position: fixed;
        top: 50%;
        left: 50%;
        min-width: 200px;
        margin-left: -100px;
        z-index: 99999;
        padding: 15px;
        border: 1px solid transparent;
        border-radius: 4px;
    }

    .BtnClass1 {
        width: 150px;
        height: 40px;
        position: absolute;
        /*padding: .5em 2em .55em;*/
        vertical-align: middle;
        color: #606060;
        border: solid 1px #b7b7b7;
        background: #fff;
        background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ededed));
        display: inline-block;
        outline: none;
        cursor: pointer;
        text-align: center;
        vertical-align: central;
        text-decoration: none;
        font: 15px/100% 'Microsoft yahei',Arial, Helvetica, sans-serif;
        text-shadow: 0 1px 1px rgb(0 0 0 / 30%);
        -webkit-border-radius: .5em;
        -moz-border-radius: .5em;
        border-radius: .5em;
        -webkit-box-shadow: 0 1px 2px rgb(0 0 0 / 20%);
        -moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
        box-shadow: 0 1px 2px rgb(0 0 0 / 20%);
        z-index: 9999;
        /*限制 按钮 不能被选中*/
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }

        .BtnClass1:hover {
            background: #ededed;
            background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#dcdcdc));
            background: -moz-linear-gradient(top, #fff, #dcdcdc);
            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#dcdcdc');
        }

        .BtnClass1:active {
            color: #999;
            background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#fff));
            background: -moz-linear-gradient(top, #ededed, #fff);
            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#ffffff');
        }

</style>


<div class="BtnClass1"  onclick="GotoFinishRate()">
    <a style="top: 30%; position: relative;" >昨日产量完成率</a>
</div>


<div style="margin-top:0.2%">
    <div class="alert" id="alertID"></div>
    <div class="BigChart">

        <div id="c1" style=" height: 100%; width: 100%" onclick="CSum_Onclick()"></div>
        @*<table style="top:0px" border="0">
                <tr>
                    <td id="Running">运行中:</td>
                    <td id="FullStatus">满锭:</td>
                    <td id="StopStatus">停机:</td>
                    <td id="AlarmStatus">报警:</td>
                </tr>
            </table>*@

    </div>

    <div class="SmallChart">
        <div id="c2" style=" height: 95%; width: 100%">

        </div>

        
        <div id="c3" style="height: 95%;width: 100%"></div>

        <div id="btnC2" style="
            z-index: 1;
            position: relative;
            margin-left: 33.45%;
            margin-top: 25.4%;
            height: 190px;
            width: 190px;
            border-radius: 50%;
        " onclick="C2_Onclick()">
        </div>

        <div id="btnC3" style="
         z-index: 1;
        position: relative;
        margin-left: 33.45%;
        margin-top: 50.9%;
        height: 190px;
        width: 190px;
        border-radius: 50%;
        " onclick="C3_Onclick()">
        </div>
    </div>
</div>
<div>
    <div class="login" id="loginFrm" style="border:2px solid black; ">
        <div id="div_uidpwd">
            <div style="margin-top: 28px; text-align: center;">
                <p style="display:inline">用户名:</p>
                <input id="uid_inputBox" type="text" value="">
            </div>
            <div style="margin-top: 8px; text-align: center;">
                <p style="display:inline">密&nbsp;&nbsp;&nbsp;码:</p>
                <input id="pwd_inputBox" type="password" value="">
            </div>
        </div>
        <div style=" text-align:center;margin-top:20px">
            <input class="btn-primary myButton" id="btnLogin" type="button" value="登录" onclick="LoginFrm_BtnLogin_Click()"> <!--sdf -->
            <input class="btn-primary myButton" id="btnCancel" type="button" value="关闭" onclick="LoginFrm_BtnCancel_Click('loginFrm')">
        </div>
        <div id="Panel1" style="top: 33%; left: 25%; height: 200px; position: relative;">
            <input class="btnLogin" id="btnAddRunningSpindleNum" type="button" value="增加运行锭数" onclick="btnAddRunningSpindleNum_Click()" />
            <input class="btnLogin" id="btnExitLogin" type="button" value="退出登录" onclick="BtnExitLogin_Click() " />
        </div>
        <input class="btnCloseWin" id="btnCloseLoginFrm" type="button" value="X" onclick="LoginFrmBtnClose_Click()" />
    </div>
    <div class="loginBtn" id="ModBtn" style="        /*border: 1px solid #FF6699;*/
        width: 30px;
        height: 30px;
        position: absolute;
        right: 2px;
        top: 2px;
         ">
        @* 取消 登录功能 *@
        @*<input class="btnOpen" type="button" value="" onclick='BtnOpenLoginFrm_Click()'>*@
    </div>

    <div class="modal fade" id="RunningSpindleFrmModal" tabindex="-1" role="dialog" data-backdrop="static" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title" id="myModalLabel">运行锭数修改</h4>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                </div>
                <div class="modal-body">

                    <div class="form-group">
                        <label for="txt_departmentname">1科运行锭数</label>
                        <input type="text" name="K1RunningSpindleNum" class="form-control" id="inputk1_RunningSpindleNum" placeholder="(可为负数)"
                               oninput="value = value.replace(/[^\d-]/g, '')" />
                        <label for="txt_departmentname">2科运行锭数</label>
                        <input type="text" name="K2RunningSpindleNum" class="form-control" id="inputk2_RunningSpindleNum" placeholder="(可为负数)"
                               oninput="value = value.replace(/[^\d-]/g, '')" />
                        <!--oninput="value = isNaN(parseFloat(value))? 0 : parseFloat(value)">-->
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" id="btn_Close_RunningSpindleFrmModal" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span>关闭</button>
                    <button type="button" id="btn_submit" class="btn btn-primary" data-dismiss="modal" onclick="BtnSaveRunningRate_Click()"><span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>保存</button>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="/echarts/echarts.js"></script>
<script type="text/javascript">

    function GotoFinishRate() {
        window.open('/Yield/Index','_self');
    }

    document.onkeydown = function (e) { // 回车提交表单
        // 兼容FF和IE和Opera
        var theEvent = window.event || e;
        var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
        if (code == 13) {
            LoginFrm_BtnLogin_Click();
        }
    }

    var dc1 = document.getElementById("c1");
    var dc2 = document.getElementById("c2");
    var dc3 = document.getElementById("c3");

    window.onload = function () {
        $("#btnExitLogin").hide();
        $("#btnAddRunningSpindleNum").hide();
        $("#loginFrm").hide();

        $("#pwd_inputBox").val("");

        // 载入完成之后
        // 如需 调用传参 的函数 必须 用 无参函数 包裹。
        //setInterval(function () {
        //    if ($("#RunningSpindleFrmModal").css('display') != 'none') {
        //        $("#loginFrm").hide();
        //        showalert("警告: 登录超时，即将 退出登录。");
        //        BtnExitLogin_Click();
        //    }


        //}, 15000);

        //-------------------------登录超时功能------------------------------
        //setInterval(function () {
        //    if (isLoginSuccessed) {
        //        BtnExitLogin_Click();
        //        //showalert("账号超时; 为了防止无关人员修改 与防止您忘记 退出登录;");
        //    }
        //}, 15000);

        setTimeout(getChartData, 300);
        setInterval(getChartData, 10000);
    }

    function LoginFrmBtnClose_Click() {
        $("#loginFrm").hide();

    }

    function LoginFrm_BtnCancel_Click(id) {
        $("#loginFrm").hide();
    }

    function BtnExitLogin_Click() {
        $("#btnLogin").show();
        $("#btnCancel").show();
        $("#div_uidpwd").show();
        $("#btnExitLogin").hide();
        $('#btnAddRunningSpindleNum').hide();
        isLoginSuccessed = false;
    }

    var isLoginSuccessed = false;
    //admin
    //admin123
    function LoginFrm_BtnLogin_Click() {

        //.val() 才能获取正确的 value
        if ($("#uid_inputBox").val() == "admin" && $("#pwd_inputBox").val() == "admin123") {
            //alert("恭喜登录成功!");
            $("#loginFrm").hide();
            $("#btnLogin").hide();
            $("#btnCancel").hide();
            isLoginSuccessed = true;
            $("#btnExitLogin").show();
            $("#div_uidpwd").hide();

            $("#btnExitLogin").css('Top', '50%');
            $("#btnExitLogin").css('Left', '50%');

            $("#myModalLabel").text("运行锭数修改");
            $('#RunningSpindleFrmModal').modal();
            $('#btnAddRunningSpindleNum').show();
            $("#btnCloseLoginFrm").show();
        }
        else {
            showalert("密码错误 请重新输入.");
        }
    }
    function btnAddRunningSpindleNum_Click()
    {
        $('#RunningSpindleFrmModal').modal();
    }

    var g_K1RunSpindleBonus = @ViewData["K1RunDingAddition"];
    var g_K2RunSpindleBonus = @ViewData["K2RunDingAddition"];
    function BtnSaveRunningRate_Click() {
        g_K1RunSpindleBonus += Number($("#inputk1_RunningSpindleNum").val());
        g_K2RunSpindleBonus += Number($("#inputk2_RunningSpindleNum").val());
        getChartData();
    }



    var LoginISShow = false;
    function BtnOpenLoginFrm_Click() {
        if ($("#loginFrm").css('display')=='none')
            $("#loginFrm").show();
        else
            $("#loginFrm").hide();
        //if(x.style.display== 'none')
        //x.style.display = 'block';
        //LoginISShow = true;
    }

    //    dc1.onclick = function (param) {
    //        var pname = param.name;
    //        alert(pname);
    //};

    function C2_Onclick() {
        //_self 表示 打开内部页面  如 localhost:44314/www.baidu.com
                //window.open('@ViewData["K1URL"]', '_self');
        window.open('@ViewData["K1URL"]','@ViewData["OpenURLPattern"]');
        //window.open('first','@ViewData["OpenURLPattern"]');
    }

    function C3_Onclick() {
        window.open('@ViewData["K2URL"]', '@ViewData["OpenURLPattern"]');
    }

    function CSum_Onclick(){

    }


    //Chart1.hideLoading();
    //Chart2.hideLoading();

    var ChartAll = echarts.init(dc1);
    var ChartK1 = echarts.init(dc2);
    var ChartK2 = echarts.init(dc3);
    //var btn1 = document.getElementById("Btn1");

    //    btn1.onclick()
    function fomatFloat(num, pos) {
        // Math.pow(x,y) x 的 y 次幂
        return Math.round(num * Math.pow(10, pos)) / Math.pow(10, pos);
    }

    var g_k1停机数 = 0;
    var g_k2停机数 = 0;

    function showalert(alertmsg) {
        $("#alertID").html(alertmsg).addClass('alert-success').show().delay(1000).fadeOut();
    }

    function getChartData() {
        $.ajax({
            type: "post",
            async: false,
            url: "/Home/GetAllCharts",
            // 发回去后台， 已经是 多余的了, 领导说不需要，在页面上 可修改。
            data: { 'k1RunDingBonus': g_K1RunSpindleBonus, 'k2RunDingBonus': g_K2RunSpindleBonus},
            dataType: "json",
            error: function (errorMsg) { /*alert("请求数据失败" + errorMsg);*/ },
            success: function (result) {
                //不断清除密码，防止 随便登录
                $("#pwd_inputBox").val("");
                var sumobj = [{ name: "飞机", value: 1 }, { name: "火箭", value: 2 }];
                var c1obj = [{ name: "飞机", value: 1 }, { name: "火箭", value: 2 }];
                var c2obj = [{ name: "飞机", value: 1 }, { name: "火箭", value: 2 }];
                sumobj.splice(0, sumobj.length);
                c1obj.splice(0, c1obj.length);
                c2obj.splice(0, c2obj.length);
                //演示一下字典的用法
                for (var i = 0; i < result.k1rate.length; i++) {
                    // console.log(result.date.length)
                    // console.log(result.date[i].name)
                    c1obj[i] = { name: result.k1rate[i].name, value: result.k1rate[i].value };
                }
                for (var i = 0; i < result.k2rate.length; i++) {
                    c2obj[i] = { name: result.k2rate[i].name, value: result.k2rate[i].value };
                }
                for (var i = 0; i < result.kAllrate.length; i++) {
                    //这句是为了 保留2为小数。 其实就是 向左偏移2位，取整（含四舍五入），再往右偏移2位，就是x100，就能保留2位小数且四舍五入的。
                    //Math.round(result.kAllrate[i].value * 100) / 100
                    sumobj[i] = { name: result.kAllrate[i].name, value: Math.round(result.kAllrate[i].value * 100) / 100 };
                }
                //==========================一科======================
                //为了 开动率好看!

                //

                g_K1RunSpindleBonus = result.dpk.k1RunDingBonus;
                g_K2RunSpindleBonus = result.dpk.k2RunDingBonus;

                var k1满锭数 = result.k1Detail[1].value;
                var k1运行中 = result.k1Detail[0].value + g_K1RunSpindleBonus + k1满锭数;

                //为了 开动率好看!
                var k1停机数 = result.k1Detail[2].value - g_K1RunSpindleBonus;
                g_k1停机数 = k1停机数;
                var k1报警数 = result.k1Detail[3].value;
                var k1总锭数 = k1运行中 + k1停机数 + k1报警数;
                //修正1科开动率
                c1obj[0].value = k1运行中 / k1总锭数 * 100;
                c1obj[1].value = 100 - c1obj[0].value; //非开动率

                //==========================二科======================

                var k2满锭数 = result.k2Detail[1].value;
                var k2运行中 = result.k2Detail[0].value + g_K2RunSpindleBonus + k2满锭数;

                var k2停机数 = result.k2Detail[2].value- g_K2RunSpindleBonus;
                g_k2停机数 = k2停机数;
                var k2报警数 = result.k2Detail[3].value;
                var k2总锭数 = k2运行中 + k2停机数 + k2报警数;
                c2obj[0].value = k2运行中 / k2总锭数 * 100;
                c2obj[1].value = 100 - c2obj[0].value; //非开动率

                //=========================汇总========================
                //var kAll满锭数 = result.kAllDetail[1].value;  //
                //var kAll运行中 = result.kAllDetail[0].value + result.kAllDetail[1].value;
                var kAll运行中 = k2运行中+k1运行中;  //是因为现在 一二科满锭 已合并到【运行数】了。
                var kAll停机数 = k1停机数 + k2停机数;
                var kAll报警数 = k1报警数 + k2报警数;
                var kAll总锭数 = k1总锭数 + k2总锭数;

                sumobj[0].value = kAll运行中 / kAll总锭数 * 100;  //开动率
                sumobj[1].value = 100 - sumobj[0].value;//非开动率

                //"开动率"
                //"停止率"
                //"故障率"
                //"完成率"

                var UptimeAll = sumobj[0].value.toFixed(1) + "%";
                var Uptime1 = c1obj[0].value.toFixed(1) + "%";
                var Uptime2 = c2obj[0].value.toFixed(1) + "%";

                var CsumOpt =
                {
                    color: ['lightgreen', 'lightgray', '#61a0a8', '#d48265', '#91c7ae', '#749f83', '#ca8622', '#bda29a', '#6e7074', '#546570', '#c4ccd3'],
                    title: {
                        text: '总开动率',
                        left: 'center',
                        top: '1%',
                        textStyle: {
                            //文字颜色
                            color: 'lightgreen',
                            //字体风格,'normal','italic','oblique'
                            fontStyle: 'normal',
                            //字体粗细 'normal','bold','bolder','lighter',100 | 200 | 300 | 400...
                            fontWeight: 'bold',
                            //字体系列
                            fontFamily: 'sans-serif',
                            //字体大小
                            fontSize: 50
                        }
                    },
                    tooltip: {
                        show: false,
                        trigger: 'item'
                        //formatter: '{a} <br/>{b}: {d}%'
                    },
                    graphic: [{ //环形图中间添加文字
                        type: 'text', //通过不同top值可以设置上下显示
                        left: 'center',
                        top: '43%',
                        style: {
                            text: UptimeAll,
                            textAlign: 'center',
                            fill: 'lightgreen', //文字的颜色
                            width: 80,
                            height: 40,
                            fontSize: 100,
                            fontFamily: "Microsoft YaHei"
                        }
                    },
                    { //底部细节栏
                        type: 'text', //通过不同top值可以设置上下显示
                        left: 'center',
                        top: '87%',
                        style: {
                            text: "总锭数: " + kAll总锭数
                            ,
                            textAlign: 'center',
                            fill: '#ddd', //文字的颜色
                            width: 40,
                            height: 40,
                            fontSize: 40,
                            fontFamily: "Microsoft YaHei"
                        }
                    },

                    { //底部细节栏
                        type: 'text', //通过不同top值可以设置上下显示
                        left: 'center',
                        top: '93%',
                        style: {
                            //text: "运行中: " + kAll运行中 + "    满锭: " + kAll满锭数 + "    停机: " + kAll停机数 + "    故障: " + kAll报警数
                            text: "运行中: " + kAll运行中 + "    停机: " + kAll停机数 + "    故障: " + kAll报警数
                            ,
                            textAlign: 'center',
                            fill: '#ddd', //文字的颜色
                            width: 40,
                            height: 40,
                            fontSize: 40,
                            fontFamily: "Microsoft YaHei"
                        }
                    }
                    ]
                    ,
                    series: [
                        {
                            animation: true,
                            name: '总开动率',
                            type: 'pie',
                            radius: ['45%', '75%'],
                            center: ['50%', '47%'],
                            avoidLabelOverlap: false,
                            label: {
                                show: false,
                                position: 'center',
                                fontSize: '30',
                                fontWeight: 'bold'
                            },
                            labelLine: {
                                show: false
                            },
                            data: sumobj
                            ,

                            animationDuration: 700,
                            animationDelay: function (idx) {
                                return 100;
                            },
                            animationDurationUpdate: function (idx) {
                                // 越往后的数据时长越大
                                return 100;
                            },
                            animationDelayUpdate: function (idx) {
                                // 越往后的数据延迟越大
                                return 100;
                            }
                        }
                    ]
                };

                var C1opt =
                {
                    color: ['#688fe4', 'lightgray', '#61a0a8', '#d48265', '#91c7ae', '#749f83', '#ca8622', '#bda29a', '#6e7074', '#546570', '#c4ccd3'],
                    title: {
                        text: '一科开动率',
                        left: 'center',
                        top: '1%',
                        textStyle: {
                            //文字颜色
                            color: '#688fe4',
                            //字体风格,'normal','italic','oblique'
                            fontStyle: 'normal',
                            //字体粗细 'normal','bold','bolder','lighter',100 | 200 | 300 | 400...
                            fontWeight: 'bold',
                            //字体系列
                            fontFamily: 'sans-serif',
                            //字体大小
                            fontSize: 35
                        }
                    },
                    tooltip: {
                        show: false,
                        trigger: 'item'
                    },
                    graphic: [{ //环形图中间添加文字
                        type: 'text', //通过不同top值可以设置上下显示
                        left: 'center',
                        top: '43%',
                        style: {
                            text: Uptime1,
                            textAlign: 'center',
                            fill: 'lightgreen', //文字的颜色
                            width: 40,
                            height: 40,
                            fontSize: 40,
                            fontFamily: "Microsoft YaHei"
                        }
                    },
                    { //底部细节栏
                        type: 'text', //通过不同top值可以设置上下显示
                        left: 'center',
                        top: '84%',
                        style: {
                            text: "总锭数: " + k1总锭数,
                            textAlign: 'center',
                            fill: '#ddd', //文字的颜色
                            width: 40,
                            height: 40,
                            fontSize: 25,
                            fontFamily: "Microsoft YaHei"
                        }
                    },
                    { //底部细节栏
                        type: 'text', //通过不同top值可以设置上下显示
                        left: 'center',
                        top: '91%',
                        style: {
                            //text: "运行中: " + k1运行中 + "    满锭: " + k1满锭数 + "    停机: " + k1停机数 + "    故障: " + k1报警数
                            text: "运行中: " + k1运行中 + "    停机: " + k1停机数 + "    故障: " + k1报警数
                            ,
                            textAlign: 'center',
                            fill: '#ddd', //文字的颜色
                            width: 40,
                            height: 40,
                            fontSize: 25,
                            fontFamily: "Microsoft YaHei"
                        }
                    },
                    ],
                    series: [
                        {
                            animation: true,
                            name: '一科开动率',
                            type: 'pie',
                            radius: ['40%', '70%'],
                            center: ["50%", "46%"],
                            avoidLabelOverlap: true,
                            label: {
                                show: false,
                                position: 'center',
                                fontSize: '28',
                                fontWeight: 'bold'
                            },
                            emphasis: {
                                label: {
                                    show: false,
                                    fontSize: '40',
                                    fontWeight: 'bold'
                                }
                            },
                            labelLine: {
                                show: false
                            },
                            data: c1obj
                            ,
                            animationDuration: 700,
                            animationDelay: function (idx) {
                                return 100;
                            },
                            animationDurationUpdate: function (idx) {
                                // 越往后的数据时长越大
                                return 100;
                            },
                            animationDelayUpdate: function (idx) {
                                // 越往后的数据延迟越大
                                return 100;
                            }
                        }
                    ]
                };

                var C2opt = {
                    color: ['yellow', 'lightgray', '#61a0a8', '#d48265', '#91c7ae', '#749f83', '#ca8622', '#bda29a', '#6e7074', '#546570', '#c4ccd3'],
                    title: {
                        text: '二科开动率',
                        left: 'center',
                        top: '1%',
                        textStyle: {
                            //文字颜色
                            color: 'yellow',
                            //字体风格,'normal','italic','oblique'
                            fontStyle: 'normal',
                            //字体粗细 'normal','bold','bolder','lighter',100 | 200 | 300 | 400...
                            fontWeight: 'bold',
                            //字体系列
                            fontFamily: 'sans-serif',
                            //字体大小
                            fontSize: 35
                        }
                    },
                    tooltip: {
                        show: false,
                        trigger: 'item'
                        //formatter: '{a} <br/>{b}: {d}%'
                    },
                    graphic: [{ //环形图中间添加文字
                        type: 'text', //通过不同top值可以设置上下显示
                        left: 'center',
                        top: '43%',
                        style: {
                            text: Uptime2,
                            textAlign: 'center',
                            fill: 'lightgreen', //文字的颜色
                            width: 40,
                            height: 40,
                            fontSize: 40,
                            fontFamily: "Microsoft YaHei"
                        }
                    },
                    { //底部细节栏
                        type: 'text', //通过不同top值可以设置上下显示
                        left: 'center',
                        top: '84%',
                        style: {
                            text: "总锭数: " + k2总锭数,
                            textAlign: 'center',
                            fill: '#ddd', //文字的颜色
                            width: 40,
                            height: 40,
                            fontSize: 25,
                            fontFamily: "Microsoft YaHei"
                        }
                    },
                    { //底部细节栏
                        type: 'text', //通过不同top值可以设置上下显示
                        left: 'center',
                        top: '91%',
                        style: {
                            //text: "运行中: " + k2运行中 + "    满锭: " + k2满锭数 + "    停机: " + k2停机数 + "    故障: " + k2报警数,
                            text: "运行中: " + k2运行中 + "    停机: " + k2停机数 + "    故障: " + k2报警数,
                            textAlign: 'center',
                            fill: '#ddd', //文字的颜色
                            width: 40,
                            height: 40,
                            fontSize: 25,
                            fontFamily: "Microsoft YaHei"
                        }
                    }],
                    series: [
                        {
                            animation: true,
                            name: '二科',
                            type: 'pie',
                            radius: ['40%', '70%'],
                            center: ["50%", "46%"],
                            avoidLabelOverlap: true,
                            label: {
                                show: false,
                                position: 'center',
                                fontSize: '30',
                                fontWeight: 'bold'
                            },
                            emphasis: {
                                label: {
                                    show: false,
                                    fontSize: '40',
                                    fontWeight: 'bold'
                                }
                            },
                            labelLine: {
                                show: false
                            },
                            data: c2obj
                            ,
                            animationDuration: 700,
                            animationDelay: function (idx) {
                                return 100;
                            },
                            animationDurationUpdate: function (idx) {
                                // 越往后的数据时长越大
                                return 100;
                            },
                            animationDelayUpdate: function (idx) {
                                // 越往后的数据延迟越大
                                return 100;
                            }
                        }
                    ]
                };
                // 使用刚指定的配置项和数据显示图表。
                ChartAll.setOption(CsumOpt);
                ChartK1.setOption(C1opt);
                ChartK2.setOption(C2opt);
            }

        });
    }
</script>
